﻿Public Class roomForm
    Dim roomClass As New roomClass
    Dim checkRoomAva As New checkRoomAvailabilityClass
    Private room1 As String
    Private room2 As String
    Private room3 As String
    Private room4 As String
    Private room5 As String
    Private room6 As String
    Private condition As String
    Private roomType As Integer
    Private ava As String
    Private ava1 As Integer
    Private ava2 As Integer
    Dim checkRooms As New checkRooms

    Public Sub setCond(ByVal cond)
        condition = cond
    End Sub

    Private Sub roomForm_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
        roomType = checkRooms.checkRoomType()
        currLvTxt.Text = "1"
        room1Btn.Text = 101
        room2Btn.Text = 102
        room3Btn.Text = 103
        room4Btn.Text = 104
        room5Btn.Text = 105
        room6Btn.Text = 106
        room1 = checkRoomAva.checkRooms(101)
        room2 = checkRoomAva.checkRooms(102)
        room3 = checkRoomAva.checkRooms(103)
        room4 = checkRoomAva.checkRooms(104)
        room5 = checkRoomAva.checkRooms(105)
        room6 = checkRoomAva.checkRooms(106)
        If (condition = "online") Then
            finishBookingBtn.Visible = False
            userDetailsForm.setCond("online")
            If (roomType = 1 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (roomType = 1 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (roomType = 1 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (roomType = 1 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (roomType = 2 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (roomType = 2 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        ElseIf (condition = "checkin") Then
            finishBookingBtn.Visible = True
            userDetailsForm.setCond("checkin")
            ava = checkRoomAva.checkRoomTypeAva()
            Dim words As String() = ava.Split(" ")
            ava1 = Convert.ToInt32(words(1))
            ava2 = Convert.ToInt32(words(2))
            If (ava2 <= 0 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        End If
    End Sub

    Private Sub roomForm_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        mainForm.Close()
        checkInForm.Close()
    End Sub

    Private Sub roomForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        logoPic.Location = New System.Drawing.Point(((mapPanel.Width / 2) - (logoPic.Width / 2)), 3)
        mapPanel.Location = New System.Drawing.Point(((Me.Width / 2) - (mapPanel.Width / 2)), ((Me.Height / 2) - (mapPanel.Height / 2)))
    End Sub

    Private Sub firstFloBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles firstFloBtn.Click
        currLvTxt.Text = 1
        room1Btn.Text = 101
        room2Btn.Text = 102
        room3Btn.Text = 103
        room4Btn.Text = 104
        room5Btn.Text = 105
        room6Btn.Text = 106
        room1 = checkRoomAva.checkRooms(101)
        room2 = checkRoomAva.checkRooms(102)
        room3 = checkRoomAva.checkRooms(103)
        room4 = checkRoomAva.checkRooms(104)
        room5 = checkRoomAva.checkRooms(105)
        room6 = checkRoomAva.checkRooms(106)
        If (condition = "online") Then
            finishBookingBtn.Visible = False
            userDetailsForm.setCond("online")
            If (roomType = 1 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (roomType = 1 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (roomType = 1 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (roomType = 1 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (roomType = 2 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (roomType = 2 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        ElseIf (condition = "checkin") Then
            finishBookingBtn.Visible = True
            userDetailsForm.setCond("checkin")
            ava = checkRoomAva.checkRoomTypeAva()
            Dim words As String() = ava.Split(" ")
            ava1 = Convert.ToInt32(words(1))
            ava2 = Convert.ToInt32(words(2))
            If (ava2 <= 0 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        End If
    End Sub

    Private Sub secondFloBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles secondFloBtn.Click
        currLvTxt.Text = 2
        room1Btn.Text = 201
        room2Btn.Text = 202
        room3Btn.Text = 203
        room4Btn.Text = 204
        room5Btn.Text = 205
        room6Btn.Text = 206
        room1 = checkRoomAva.checkRooms(201)
        room2 = checkRoomAva.checkRooms(202)
        room3 = checkRoomAva.checkRooms(203)
        room4 = checkRoomAva.checkRooms(204)
        room5 = checkRoomAva.checkRooms(205)
        room6 = checkRoomAva.checkRooms(206)
        If (condition = "online") Then
            finishBookingBtn.Visible = False
            userDetailsForm.setCond("online")
            If (roomType = 1 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (roomType = 1 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (roomType = 1 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (roomType = 1 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (roomType = 2 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (roomType = 2 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        ElseIf (condition = "checkin") Then
            finishBookingBtn.Visible = True
            userDetailsForm.setCond("checkin")
            ava = checkRoomAva.checkRoomTypeAva()
            Dim words As String() = ava.Split(" ")
            ava1 = Convert.ToInt32(words(1))
            ava2 = Convert.ToInt32(words(2))
            If (ava2 <= 0 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        End If
    End Sub

    Private Sub thirdFloBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles thirdFloBtn.Click
        currLvTxt.Text = 3
        room1Btn.Text = 301
        room2Btn.Text = 302
        room3Btn.Text = 303
        room4Btn.Text = 304
        room5Btn.Text = 305
        room6Btn.Text = 306
        room1 = checkRoomAva.checkRooms(301)
        room2 = checkRoomAva.checkRooms(302)
        room3 = checkRoomAva.checkRooms(303)
        room4 = checkRoomAva.checkRooms(304)
        room5 = checkRoomAva.checkRooms(305)
        room6 = checkRoomAva.checkRooms(306)
        If (condition = "online") Then
            finishBookingBtn.Visible = False
            userDetailsForm.setCond("online")
            If (roomType = 1 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (roomType = 1 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (roomType = 1 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (roomType = 1 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (roomType = 2 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (roomType = 2 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        ElseIf (condition = "checkin") Then
            finishBookingBtn.Visible = True
            userDetailsForm.setCond("checkin")
            ava = checkRoomAva.checkRoomTypeAva()
            Dim words As String() = ava.Split(" ")
            ava1 = Convert.ToInt32(words(1))
            ava2 = Convert.ToInt32(words(2))
            If (ava2 <= 0 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        End If
    End Sub

    Private Sub forthFloBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles forthFloBtn.Click
        currLvTxt.Text = 4
        room1Btn.Text = 401
        room2Btn.Text = 402
        room3Btn.Text = 403
        room4Btn.Text = 404
        room5Btn.Text = 405
        room6Btn.Text = 406
        room1 = checkRoomAva.checkRooms(401)
        room2 = checkRoomAva.checkRooms(402)
        room3 = checkRoomAva.checkRooms(403)
        room4 = checkRoomAva.checkRooms(404)
        room5 = checkRoomAva.checkRooms(405)
        room6 = checkRoomAva.checkRooms(406)
        If (condition = "online") Then
            finishBookingBtn.Visible = False
            userDetailsForm.setCond("online")
            If (roomType = 1 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (roomType = 1 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (roomType = 1 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (roomType = 1 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (roomType = 2 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (roomType = 2 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        ElseIf (condition = "checkin") Then
            finishBookingBtn.Visible = True
            userDetailsForm.setCond("checkin")
            ava = checkRoomAva.checkRoomTypeAva()
            Dim words As String() = ava.Split(" ")
            ava1 = Convert.ToInt32(words(1))
            ava2 = Convert.ToInt32(words(2))
            If (ava2 <= 0 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        End If
    End Sub

    Private Sub fifthFloBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles fifthFloBtn.Click
        currLvTxt.Text = 5
        room1Btn.Text = 501
        room2Btn.Text = 502
        room3Btn.Text = 503
        room4Btn.Text = 504
        room5Btn.Text = 505
        room6Btn.Text = 506
        room1 = checkRoomAva.checkRooms(501)
        room2 = checkRoomAva.checkRooms(502)
        room3 = checkRoomAva.checkRooms(503)
        room4 = checkRoomAva.checkRooms(504)
        room5 = checkRoomAva.checkRooms(505)
        room6 = checkRoomAva.checkRooms(506)
        If (condition = "online") Then
            finishBookingBtn.Visible = False
            userDetailsForm.setCond("online")
            If (roomType = 1 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (roomType = 1 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (roomType = 1 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (roomType = 1 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (roomType = 2 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (roomType = 2 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        ElseIf (condition = "checkin") Then
            finishBookingBtn.Visible = True
            userDetailsForm.setCond("checkin")
            ava = checkRoomAva.checkRoomTypeAva()
            Dim words As String() = ava.Split(" ")
            ava1 = Convert.ToInt32(words(1))
            ava2 = Convert.ToInt32(words(2))
            If (ava2 <= 0 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        End If
    End Sub

    Private Sub sixthFloBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sixthFloBtn.Click
        currLvTxt.Text = 6
        room1Btn.Text = 601
        room2Btn.Text = 602
        room3Btn.Text = 603
        room4Btn.Text = 604
        room5Btn.Text = 605
        room6Btn.Text = 606
        room1 = checkRoomAva.checkRooms(601)
        room2 = checkRoomAva.checkRooms(602)
        room3 = checkRoomAva.checkRooms(603)
        room4 = checkRoomAva.checkRooms(604)
        room5 = checkRoomAva.checkRooms(605)
        room6 = checkRoomAva.checkRooms(606)
        If (condition = "online") Then
            finishBookingBtn.Visible = False
            userDetailsForm.setCond("online")
            If (roomType = 1 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (roomType = 1 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (roomType = 1 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (roomType = 1 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (roomType = 2 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (roomType = 2 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        ElseIf (condition = "checkin") Then
            finishBookingBtn.Visible = True
            userDetailsForm.setCond("checkin")
            ava = checkRoomAva.checkRoomTypeAva()
            Dim words As String() = ava.Split(" ")
            ava1 = Convert.ToInt32(words(1))
            ava2 = Convert.ToInt32(words(2))
            If (ava2 <= 0 Or room1 = "Occupied") Then
                room1Btn.BackColor = Color.Red
                room1Btn.Enabled = False
            Else
                room1Btn.BackColor = Color.PaleGreen
                room1Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room2 = "Occupied") Then
                room2Btn.BackColor = Color.Red
                room2Btn.Enabled = False
            Else
                room2Btn.BackColor = Color.PaleGreen
                room2Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room3 = "Occupied") Then
                room3Btn.BackColor = Color.Red
                room3Btn.Enabled = False
            Else
                room3Btn.BackColor = Color.PaleGreen
                room3Btn.Enabled = True
            End If
            If (ava2 <= 0 Or room4 = "Occupied") Then
                room4Btn.BackColor = Color.Red
                room4Btn.Enabled = False
            Else
                room4Btn.BackColor = Color.PaleGreen
                room4Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room5 = "Occupied") Then
                room5Btn.BackColor = Color.Red
                room5Btn.Enabled = False
            Else
                room5Btn.BackColor = Color.PaleGreen
                room5Btn.Enabled = True
            End If
            If (ava1 <= 0 Or room6 = "Occupied") Then
                room6Btn.BackColor = Color.Red
                room6Btn.Enabled = False
            Else
                room6Btn.BackColor = Color.PaleGreen
                room6Btn.Enabled = True
            End If
        End If
    End Sub

    Private Sub backBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles backBtn.Click
        Me.Hide()
    End Sub

    Private Sub room6Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles room6Btn.Click
        roomClass.bookRoom(room6Btn.Text)
    End Sub

    Private Sub room5Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles room5Btn.Click
        roomClass.bookRoom(room5Btn.Text)
    End Sub

    Private Sub room4Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles room4Btn.Click
        roomClass.bookRoom(room4Btn.Text)
    End Sub

    Private Sub room3Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles room3Btn.Click
        roomClass.bookRoom(room3Btn.Text)
    End Sub

    Private Sub room2Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles room2Btn.Click
        roomClass.bookRoom(room2Btn.Text)
    End Sub

    Private Sub room1Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles room1Btn.Click
        roomClass.bookRoom(room1Btn.Text)
    End Sub

    Private Sub finishBookingBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles finishBookingBtn.Click
        userDetailsForm.Close()
        checkInForm.Close()
        mainForm.Show()
        Me.Hide()

    End Sub

    Private Sub mapPanel_Paint(sender As System.Object, e As System.Windows.Forms.PaintEventArgs) Handles mapPanel.Paint

    End Sub
End Class